package org.example.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.util.Date;

@Data
public class Person {

    // 不序列化
    @JSONField(name = "AGE")
    private int age;

    // 控制字段排序
    @JSONField(name = "LAST NAME", ordinal = 2)
    private String lastName;
    @JSONField(name = "FIRST NAME", ordinal = 1)
    private String firstName;

    // 日期显示格式
    @JSONField(name = "DATE OF BIRTH", ordinal = 3)
    private Date dateOfBirth;

    public Person(int age, String lastName, String firstName, Date dateOfBirth) {
        super();
        this.age = age;
        this.lastName = lastName;
        this.firstName = firstName;
        this.dateOfBirth = dateOfBirth;
    }
}
